import random

if 5 > 2:
    print("1111")
else:
    print("2222")

# a、b、c三个数字比较大小
# 嵌套
a = 4
b = 5
c = 6
if a > b:
    if a > c:
        print("a is the biggest")
    else:
        print("c is the biggest")
else:
    if b > c:
        print("b is the biggest")
    else:
        print("c is the biggest")

# elif 多重if
if a > b and a > c:
    print("a is the biggest")
elif b > c and b > a:
    print("b is the biggest")
elif c > a and c > b:
    print("c is the biggest")

# 猜数字

number_to_guess = random.randint(1, 100)
attempts = 0

print("欢迎来到猜数字游戏！我想了一个1到100之间的数字。")

while True:
    guess = int(input("请输入你的猜测："))
    attempts += 1

    if guess < number_to_guess:
        print("太小了！再试一次。")
    elif guess > number_to_guess:
        print("太大了！再试一次。")
    else:
        print(f"恭喜你！你猜对了数字 {number_to_guess}，共尝试了 {attempts} 次。")
        break
